a=input("Введите последовательность скобок:")
a=a.replace("","")
while "()" in a or "{}" in a or "[]" in a or "<>" in a:
    a=a.replace("()","")
    a=a.replace("{}","")
    a=a.replace("[]","")
    a=a.replace("<>","")

if len(a)==0:print("TRUE")
else : print("FALSE")
